package com.glodon.paas.document.dao.mysql;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.glodon.paas.document.dao.ProjectMemberAttendeesDao;
import com.glodon.paas.document.dao.domain.ProjectMemberAttendeesEntity;
import com.glodon.paas.document.dao.mapper.ProjectMemberAttendeesMapper;

/**
 * @author admin
 */
public class ProjectMemberAttendeesDaoImpl implements ProjectMemberAttendeesDao{

    static Logger logger = LoggerFactory.getLogger(ProjectMemberAttendeesDaoImpl.class);
    @Autowired
    private ProjectMemberAttendeesMapper projectMemberAttendeesMapper;
    @Override
    public String insert(ProjectMemberAttendeesEntity entity) {
        projectMemberAttendeesMapper.insert(entity);
        return entity.getId();
    }

    @Override
    public ProjectMemberAttendeesEntity get(String id) {
        return projectMemberAttendeesMapper.selectByPrimaryKey(id);
    }

    @Override
    public int delete(String id) {
        return 0;
    }

    @Override
    public List<ProjectMemberAttendeesEntity> getAttendees(String projectMemberId) {
        return projectMemberAttendeesMapper.getAttendees(projectMemberId);
    }

    @Override
    public int removeAttedees(String projectMemberId) {
        return projectMemberAttendeesMapper.removeAttedees(projectMemberId);
    }

    @Override
    public ProjectMemberAttendeesEntity getAttendeeByUIDandPMID(String userId, String projectMemberId) {
        return projectMemberAttendeesMapper.getAttendeeByUIDandPMID(userId,projectMemberId);
    }

    @Override
    public void updateAttendeeInvitation(String attendeeId, String invitationId) {
        projectMemberAttendeesMapper.updateAttendeeInvitation(attendeeId,invitationId);
    }
}
